var app = getApp()
Page({
    data: {
        userInfo: {},
        isShowFootNav:true,
        num:0
    },
    onLoad: function () {
    },
    //底部切换页面方法
    toUrlTap:function (e) {
        var url = e.currentTarget.dataset.url;
        if(url!='/pages/handle/handle'){
            if(url == ''){
                //develop（开发版），trial（体验版），release（正式版）
                var res = {
                    appid:app.globalData.appid,
                    path: app.globalData.path,
                    envVersion: app.globalData.envVersion
                }
                app.crossToUrl(res)
            }else {
                app.redirectTo({url: url+'?scene='+app.globalData.channelId});
            }
        }
    },
    onShow:function () {
        var pageObj = this;
        pageObj.setData({userInfo:app.globalData.userInfo});

        var opt = {
            url: app.globalData.host+"/wx/an/list.ajax",
            data: {
                'accountId':app.globalData.openId,
                'bizFlag':app.globalData.bizDoingFlag,
                'orderType':app.globalData.orderType
            },
            sucFn:function (result) {
                var num = "";
                if(result.body.orderList.length!=0){
                    num = result.body.orderList.length;
                }
                pageObj.setData({
                    "num": num
                });
            }
        };
        app.ajax(opt);
    },
    mineTap:function (e) {
    },
    idCardTap:function (e) {
        var url = e.currentTarget.dataset.url;
        app.redirectTo({url: url+'?scene='+app.globalData.channelId});
    },
    downloadTap:function(){
        app.navigateTo({url:'../download/download'});
    },
    problemTap:function () {
        app.navigateTo({url:'../problem/problem'});
    },
    callTap:function () {
        app.makePhoneCall("020-11183");
    },
    orderDoingTap:function () {
        app.navigateTo({url:'../orderlist/orderlist?bizFlag='+app.globalData.bizDoingFlag});
    },
    orderFinishTap:function () {
        app.navigateTo({url:'../orderlist/orderlist?bizFlag='+app.globalData.bizFinishFlag});
    },
    orderAllTap:function () {
        app.navigateTo({url:'../orderlist/orderlist?bizFlag='+app.globalData.bizAllFlag});
    }
});